<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>牛舍管理</title>
		
		<link href="css/mui.min.css" rel="stylesheet" type="text/css">
		<link href="css/new_file.css" rel="stylesheet" type="text/css">
		<script charset="UTF-8" src="js/config.js"></script>
		<script charset="UTF-8" src="js/testActivityName.js"></script>
		<script charset="UTF-8" src="js/core.js"></script>
		<script charset="UTF-8" src="js/cipher-core.js"></script>
		<script charset="UTF-8" src="js/tripledes.js"></script>
		<script charset="UTF-8" src="js/mode-ecb.js"></script>
		<script src="js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript" src="js/zepto.min.js"></script>
		<script type="text/javascript" src="js/spin.min.js"></script>
		<script charset="UTF-8" src="js/mui.min.js"></script>
		<script src="js/jquery.qrcode.min.js"></script>
		<script src="js/qrcode.js"></script>
		<script src="js/jquery.qrcode.js"></script>
	</head>

	<body>
		
			<div class="head-zhjf">
			<img src="images/fanhui@3x.png" class="ryjk-tx" onclick="fanhuizhuan()">
			<div class="head-zhjf-img" onclick="BatchTransfer()">
				<p style="color: white;margin-top: -4px;">批量转舍</p>
			</div>
			<p style="color: white;">转舍管理</p>
		    </div>
		    
     <div class="moban-lb">
     	<div class="moban-lb-l">
     		<div class="ziduan-mb">奶牛编号</div>    	     		
     	</div>
     	<div class="moban-lb-r" onclick="nainiuCode()">
     		<p id="nainiuCode" style="margin-top: 12px;">请选择</p>
     		
     	</div>
     	<div class="clear"></div>
     </div>
     
     <p class="div-p-zs">转出</p>
   
   	    
     <div class="moban-lb">
     	<div class="moban-lb-l">
     		<div class="ziduan-mb">牛舍</div>    	     		
     	</div>
     	<div class="moban-lb-r">
     		<p id="TurnOut" style="margin-top: 12px;"> </p> 
     	</div>
     	<div class="clear"></div>
     </div>

  <p class="div-p-zs">转入</p>

  
       <div class="moban-lb">
     	<div class="moban-lb-l">
     		<div class="ziduan-mb">牛舍</div>    	     		
     	</div>
     	<div class="moban-lb-r" onclick="niusheBut()">
     		<p id="ToChangeInto" style="margin-top: 12px;">请选择</p> 
     		
     	</div>
     	<div class="clear"></div>
     </div>
    
      
     <div class="tijiao">
            <button type="button" class="tijiao-btn" onclick="ChangeCow()">提交</button> 
      </div>
      <script type="text/javascript">
      	var TurnOutNumber = JSON.parse(localStorage.getItem('TurnOutNumber'));
      	if (TurnOutNumber == 10) {
      		
      		var TurnOutDetails = JSON.parse(localStorage.getItem('TurnOutDetails'));
      		console.log(TurnOutDetails);
      		if (TurnOutDetails != '') {
      			var str = TurnOutDetails.cowCode;
				var str1 = TurnOutDetails.houseName;
      		} else{
      			var str = JSON.parse(localStorage.getItem('nainiuCode'));
      			var str1 = JSON.parse(localStorage.getItem('TurnOut'));
      		}
      		var ToChangeInto = JSON.parse(localStorage.getItem('ToChangeInto'));
      		
			console.log(str);
			console.log(str1);
			console.log(ToChangeInto);
			$("#nainiuCode").html(str);
			$("#TurnOut").html(str1); 
			$("#ToChangeInto").html(ToChangeInto); 
      	}
      	var ToChangeIntoNumber = JSON.parse(localStorage.getItem('ToChangeIntoNumber'));
      	if (ToChangeIntoNumber == 10) {
      	
      		var ToChangeIntoDetails = JSON.parse(localStorage.getItem('ToChangeIntoDetails'));
      		console.log(ToChangeIntoDetails)
      		if (ToChangeIntoDetails != null) {
      			var str2 = ToChangeIntoDetails.houseName;
      		}else {
      			var str2 = JSON.parse(localStorage.getItem('ToChangeInto'));
      		}
      		var str = JSON.parse(localStorage.getItem('nainiuCode'));
      		var str1 = JSON.parse(localStorage.getItem('TurnOut'));
			
			console.log(ToChangeIntoDetails);
			console.log(str1);
			console.log(str2);
			$("#nainiuCode").html(str);
			$("#TurnOut").html(str1); 
			$("#ToChangeInto").html(str2); 
      	}
  	
      	function nainiuCode(){
      		localStorage.setItem('ToChangeIntoNumber',JSON.stringify(0));
      		localStorage.setItem('ToChangeInto',JSON.stringify($("#ToChangeInto").html()));
      		localStorage.setItem('TurnOutNumber',JSON.stringify(10));
      		localStorage.setItem('nainiuCode',JSON.stringify(1));
      		Cattle1();
      	}
      	function niusheBut(){
      		localStorage.setItem('TurnOutNumber',JSON.stringify(0));
      		localStorage.setItem('nainiuCode',JSON.stringify($("#nainiuCode").html()));
      		localStorage.setItem('TurnOut',JSON.stringify($("#TurnOut").html()));
      		localStorage.setItem('ToChangeIntoNumber',JSON.stringify(10));
      		Cowshed();
      		
      	}

      	function fanhuizhuan(){
      		localStorage.setItem('ToChangeIntoNumber',JSON.stringify(0));
      		localStorage.setItem('TurnOutNumber',JSON.stringify(0));
      		FunctionList();
      	}
      	function BatchTransfer(){
      		window.location = "批量转舍.html";
      	}
      </script>
	</body>
</html>
